<?php

class Application_Form_GestionPerso_ChangePassForm extends Zend_Form
{

	public function init()
	{
		$this->setName('changepassword');

		$id = new Zend_Form_Element_Hidden('id');
		$id->addFilter('Int')
		->setDecorators(array('ViewHelper','FormErrors'));

		$pwd_old = new Zend_Form_Element_Password('pwd_old');
		$pwd_old->setLabel('Ancien mot de passe : ')
		->addFilter('StripTags')
		->addFilter('StringTrim')
		// ->addValidator('StringLength', false, array(6))
		->setAttrib("autocomplete", "off")
		->setDecorators(array('ViewHelper','FormErrors','Errors'));

		$pwd_new= new Zend_Form_Element_Password('pwd_new');
		$pwd_new->setLabel('Nouveau mot de passe : ')
		->addFilter('StripTags')
		->addFilter('StringTrim')
		//	  ->addValidator('StringLength',false, array(6))
		->setAttrib("autocomplete", "off")
		->setDecorators(array('ViewHelper','FormErrors','Errors'));
		 
		$pwd_verif = new Zend_Form_Element_Password('pwd_verif');
		$pwd_verif->setLabel('Retapez le mot de passe : ')
		->addFilter('StripTags')
		->addFilter('StringTrim')
		//  ->addValidator('StringLength',false, array(6))
		->setAttrib("autocomplete", "off")
		->setDecorators(array('ViewHelper','FormErrors','Errors'));

		$send = new Zend_Form_Element_Submit('send');
		$send->setAttrib('id','send_button')
		->setLabel('Valider')
		->setAttrib('class','button')
		->setDecorators(array('ViewHelper','FormErrors','Errors'));

		$cancel = new Zend_Form_Element_Reset('cancel');
		$cancel->setAttrib('id','send_button')
		->setLabel('Annuler')
		->setAttrib('class','button')
		->setDecorators(array('ViewHelper','FormErrors','Errors'));

		$this->addElements(array($id,$pwd_old,$pwd_new,$pwd_verif,$send,$cancel));
	}

}
